From 5cfc93d26d29c131564853810dcc3fac7167780a Mon Sep 17 00:00:00 2001
From: trisusilo48 <tri.susilo@altama.co.id>
Date: Mon, 28 Oct 2024 09:33:24 +0700
Subject: capitalizeEachWord

---
 src/pages/shop/find/[slug].jsx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'src/pages/shop/find/[slug].jsx')

diff --git a/src/pages/shop/find/[slug].jsx b/src/pages/shop/find/[slug].jsx
index e7b8bd48..7174a9fb 100644
--- a/src/pages/shop/find/[slug].jsx
+++ b/src/pages/shop/find/[slug].jsx
@@ -5,6 +5,7 @@ import Seo from '@/core/components/Seo';
 import dynamic from 'next/dynamic';
 import { get } from 'lodash-contrib';
 import { getIdFromSlug, getNameFromSlug } from '@/core/utils/slug';
+import { capitalizeEachWord } from '../../../utils/capializeFIrstWord';
 
 const BasicLayout = dynamic(() =>
   import('@/core/components/layouts/BasicLayout')
@@ -17,11 +18,13 @@ const BASE_URL = 'https://indoteknik.com';
 export default function FindPage() {
   const route = useRouter();
   const qSlug = route?.query?.slug || null;
-  const url = BASE_URL + route.asPath;
+  const url = BASE_URL + route.asPath.split('?')[0];
   const [result, setResult] = useState(null);
   const [query, setQuery] = useState(null);
 
-  const slug = qSlug ? getNameFromSlug(route?.query?.slug) +' '+ getIdFromSlug(route?.query?.slug) : '';
+  const __slug = qSlug ? getNameFromSlug(route?.query?.slug) +' '+ getIdFromSlug(route?.query?.slug) : '';
+  const slug = capitalizeEachWord(__slug);
+  
   const getUrls = async (url) => {
     try {
       let response = await axios(
@@ -50,7 +53,7 @@ export default function FindPage() {
   return (
     <BasicLayout>
       <Seo
-        title={`Jual ${slug} original - indoteknik.com`}
+        title={`Jual ${slug} Original - indoteknik.com`}
         description={`Jual ${slug} Kirim Jakarta Surabaya Semarang Makassar Manado Denpasar Balikpapan Medan Palembang Lampung Bali Bandung Makassar Manado.`}
         additionalMetaTags={[
           {
-- 
cgit v1.2.3

